<template>
	<el-pagination :page-sizes="paginations.pageSizes" :page-size="size" :layout="paginations.layout"
	 :total="total" :current-page='index' @current-change='handleCurrentChange'>
	</el-pagination>
</template>

<script>
	export default {
		props:{
			total: {
			    type: Number,
			    default:0
			},
			index: {  // 当前页
			    type: Number,
			    default:1
			},
			size: {  // 总页数
			    type: Number,
			    default:15
			},
		},
		data(){
			return{
				//需要给分页组件传的信息
				paginations: {
					pageSizes: [5, 10, 15, 20], //每页显示多少条
					layout: "total, prev, pager, next" // 翻页属性
				},
			}
		},
		methods:{
			handleCurrentChange(page){
				this.$emit('change',page)
			}
		}
	}
</script>

<style>
</style>
